package com.chaber.containers.common;

import javafx.scene.control.ListCell;

import com.chaber.containers.beans.ProductCategoryData;

public class JavaFXUtils {

	public static ListCell<ProductCategoryData> getListCell() {
		ListCell<ProductCategoryData> listCell = new ListCell<ProductCategoryData>() {
			@Override
			protected void updateItem(final ProductCategoryData pCategoryData, boolean empty) {
				super.updateItem(pCategoryData, empty);

				if (!empty && pCategoryData != null) {
					this.setText(pCategoryData.getFullName());
				} else {
					this.setText(null);
					this.setGraphic(null);
				}
			}
		};
		
		return listCell;
	}
	
	
}
